package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the wishlist database table.
 * 
 */
@Embeddable
public class WishlistPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="id_wishlist")
	private int idWishlist;

	@Column(name="id_pacchetto")
	private int idPacchetto;

	public WishlistPK() {
	}
	
	public WishlistPK(int idWishlist, int idPacchetto) {
		super();
		this.idWishlist = idWishlist;
		this.idPacchetto = idPacchetto;
	}

	public int getIdWishlist() {
		return this.idWishlist;
	}
	public void setIdWishlist(int idWishlist) {
		this.idWishlist = idWishlist;
	}
	public int getIdPacchetto() {
		return this.idPacchetto;
	}
	public void setIdPacchetto(int idPacchetto) {
		this.idPacchetto = idPacchetto;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof WishlistPK)) {
			return false;
		}
		WishlistPK castOther = (WishlistPK)other;
		return 
			(this.idWishlist == castOther.idWishlist)
			&& (this.idPacchetto == castOther.idPacchetto);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idWishlist;
		hash = hash * prime + this.idPacchetto;
		
		return hash;
	}
}